<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>

<%@ page import="java.util.*,
				com.maizhi.model.*"

%>
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <jsp:include page="/liger/liger.jsp"></jsp:include>
	 <style type="text/css"> 
	    body,html{height:100%;font:12px;}
	    body{ padding:0px; margin:0; overflow:hidden; font:12px;}  
	 </style>
	 
	 <script>
		$(function(){
		
			$('#submit').click(function(){
			
				 var url = "<%=request.getContextPath()%>/xtglController.do?menuAdd";
				 
				 $.ajax({
                    type: 'post', 
                    cache: false, 
                    dataType: 'json',
                    url: url,
                    data: $('#theForm').serialize(),
                    success: function (msg)
                    {
                        if (!msg.success)
                        {
                            alert(msg.msg);
                            return;
                        } else
                        {
                            alert(msg.msg);
                        }
                    },
                    error: function ()
                    {
                        alert('发送系统错误,请与系统管理员联系!');
                    },
                    beforeSend: function ()
                    {
                        $.ligerDialog.waitting("正在保存中,请稍后...");
                        $("#submit").attr("disabled", true);
                    },
                    complete: function ()
                    {
                        $.ligerDialog.closeWaitting();
                        $("#submit").attr("disabled", false);
                    }
                });
			});	
			
		});
		
		
	</script>
  </head>
  
<body style="padding:0px;background:#EAEEF5;">  
<div id="pageloading"></div>  
 
   <form id="theForm" action="xtglController.do?menuAdd" method="post">
   	<table>
   <tr>
   <td>上级菜单:</td>
   <td><input type="text" name="pid" value="${menu.pid}"/></td>
   </tr>
   
   <tr>
   <td>菜单名称:</td>
   <td><input type="text" name="text" value="${menu.text}"/></td>
   </tr>
   
   <tr>
   <td>连接地址:</td>
   <td><input type="text" name="url" value="${menu.url}"/></td>
   </tr>
   
    <tr>
   <td>菜单图片:</td>
   <td><input type="text" name="img" value="${menu.img}"/></td>
   </tr>
   
   <tr>
   <td>菜单描述:</td>
   <td><input type="text" name="des" value="${menu.des}"/></td>
   </tr>
   
   <tr>
   <td><input type="submit" id="submit" value=" 保 存 "/></td>
   <td><input type="reset" value=" 重 置 "/></td>
   </tr>
   </table>
   </form>
</body>
</html>
